<?php

/*
 * File "index.php"
 *
 * Created on 06/mar/09
 * @author gabrielepiva
 * @email www.gabri@gmail.com
 *
 * @projectName newcomer-theme1
 * @workgroup Nerd Riot
 *
 * \brief Inserire descrizione del file
 *
 *
 */
// echo time();
require_once "config.php";
require_once SESSION_INCLUDE;
require_once DB;

session_start();

function print_admin($user)
{
	if($user->isAdmin())
		return "Amministratore";
	else return "Utente";
}

	$db = get_session_db($db_config);

	if(!user_is_logged($db))
	{
		header("Location:http://".LOGIN_FILE."?from=admin.php");
		exit();
	}

	$user = get_session_user();
?>
<html>
<?php require_once("pages/head.php"); ?>
<body>
<!-- ####### HEADER ######-->

<div class="top_bar">

	<h1><a href="" target="content" class="menu" title="index"><?php echo SITE_NAME." - ".THEME_VERSION ?></a></h1>
	<ul class="menu">
		<li><a href="json/@events/0" target="content" class="menu" title="events">Eventi</a></li> |
		<li><a href="scripts/get_json_gallery_list.php?id=<?php echo $user->getId();?>" target="content" title="gallery" class="menu">Gallerie</a></li> |
		<!--li><a href="json/@users" class="menu" title="users">Utenti</a></li-->
	</ul>
	<ul class="ncUser">
		<li>Logged as <b><a href="scripts/get_json_user.php" target="content" class="menu" title="settings"><?php echo $user->getUsername(); ?></a></b></li> |
		<li><a href="pages/help.php" target="content" class="menu" title="help" id="help">Help</a></li> |
		<li><a href="pages/help.php" target="content" class="menu" title="bug" id="help"><img style="vertical-align: top; border: 0px;"src="images/bug.png" alt="Segnala un malfunzionamento" title="Segnala un malfunzionamento" /></a></li> |
		<li><a href="logout.php" target="content" title="logout">Logout</a></li>
	</ul>
</div>
<div class="corner" id="top_corner"></div>

<!-- ### FINE HEADER ### -->

<!-- ###### CONTENT ###### -->
<div id="loading">
	<img src="images/loading_white.gif" /> Loading...
</div>
<div class="content_block">
	<div class="content_left">
	<div id="load_status"></div>
	<div id="str_bar"></div> <!-- Contiene gli strumenti (pulsanti e azioni) caricati dinamicamente -->
	<div id="content"></div>
	<div id="tooltips">
		Shortcuts avalaibles!
		<br />
		<b>g</b>: go to galleries index |
		<b>e</b>: go to events index |
		<b>s</b>: go to user settings |
		<b>h</b>: read help file |
		<b>a</b>: add a new event or gallery |
		<b>esc</b>: close instrument bar |
		<b>space</b>: quicklook [in progress...] |
	</div>
</div>

	<!--div class="shadow"><br></div-->
</div>

<!-- ###### FINE CONTENT ####### -->

<!-- ######### FOOTER ########## -->

<div class="footer">

<p>Newcomer V-0.1 - Copyright &copy;2009 NerdRiot</p>
</div>
<div class="corner" id="bottom_corner"></div>

</body>
</html>
